package cz.proks.easyhelpdesk.gwt.event;

import com.google.gwt.event.shared.EventHandler;
import com.google.gwt.event.shared.GwtEvent;

public class CancelEvent extends GwtEvent<CancelEvent.Handler>{
    public final static Type<CancelEvent.Handler> TYPE = new Type<CancelEvent.Handler>();
    
    public static interface Handler extends EventHandler {
        void onCancel(CancelEvent event);
    }
    
    public CancelEvent() {        
    }
    
    public static void fireEvent(HasCancelHandlers source) {
        source.fireEvent(new CancelEvent());
    }

    @Override
    public com.google.gwt.event.shared.GwtEvent.Type<CancelEvent.Handler> getAssociatedType() {
        return TYPE;
    }

    @Override
    protected void dispatch(CancelEvent.Handler handler) {
        handler.onCancel(this);
    }    
}
